<template>
    <div style="height: 50px;line-height: 50px;border-bottom:1px solid #ccc;display: flex;">
        <!--<Particles></Particles>-->
        <div style="width: 200px;padding-left: 30px;font-weight: bold;color: cornflowerblue">我的系统</div>
        <div style="flex: 1;">

        </div>
        <img :src="admin.avatar" style="height: 80%;padding-top: 5px;border-radius: 10px"/>
        <div style="width: 100px;">

            <el-dropdown>

                <span class="el-dropdown-link">
     {{admin.nickName || '游客'}}
    <i class="el-icon-arrow-down el-icon--right"></i>
  </span>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item @click.native="$router.push('/person')">个人信息</el-dropdown-item>
                    <el-dropdown-item @click.native="logout">退出系统</el-dropdown-item>

                </el-dropdown-menu>
            </el-dropdown>

        </div>


    </div>
</template>

<script>
    import Particles from '../components/particles/index'
    import {getAdmin, removeAdmin} from "../utils/cookies";

    export default {
        name: "Header",
        components: {Particles},
        data() {
            return {
                imgUrl: require("../assets/png/wx.jpg"),
                admin: {}
            }
        },
        created() {
            this.admin = JSON.parse(getAdmin())
        },
        methods: {
            logout() {
                removeAdmin()
                this.$router.push('/login')
            }
        }
    }
</script>

<style scoped>

</style>
